package Communication;

import java.util.HashMap;
/**
 * TODO description
 */
public class NoeudPheromone {
	
	private String nom;
	private HashMap<NoeudPheromone,AretePheromone> aretes;
	
	public NoeudPheromone (String nom)
	{
		this.nom = nom;
		aretes = new HashMap<NoeudPheromone,AretePheromone>();
	}
	
	public String getName()
	{
		return nom;
	}
	
	void addNoeud(NoeudPheromone n)
	{
		aretes.put(n,new AretePheromone(this,n));
		n.aretes.put(this,new AretePheromone(n,this));
	}
	
	public HashMap<NoeudPheromone,AretePheromone> getAretes()
	{
		return aretes;
	}
	
	public AretePheromone getArete(NoeudPheromone n)
	{
		for(AretePheromone a : aretes.values())
		{
			if(a.getArrive().equals(n))
				return a;
		}
		return null;
	}
}